<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
    
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
     Yolin
  </title>
  <meta name="generator" content="hexo-theme-yilia-plus">
  
  <link rel="shortcut icon" href="/favicon.png" />
  
  
<link rel="stylesheet" href="/css/style.css">

  
<script src="/js/pace.min.js"></script>


  

  

<link rel="alternate" href="/atom.xml" title="Yolin" type="application/atom+xml">
</head>

</html>

<body>
  <div id="app">
    <main class="content">
      
<section class="cover">
    
  <div class="cover-frame">
    <div class="bg-box">
      <img src="/images/cover2.jpg" alt="image frame" />
    </div>
    <div class="cover-inner text-center text-white">
      <h1><a href="/">Yolin</a></h1>
      <div id="subtitle-box">
        
        <span id="subtitle"></span>
        
      </div>
      <div>
        
      </div>
    </div>
  </div>
  <div class="cover-learn-more">
    <a href="javascript:void(0)" class="anchor"><i class="ri-arrow-down-line"></i></a>
  </div>
</section>



<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js"></script>

<div id="main">
  <section class="outer">
  <article class="articles">
    
    
    
    
    <article id="post-集合进阶-四-Map集合-集合嵌套" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/07/30/%E9%9B%86%E5%90%88%E8%BF%9B%E9%98%B6-%E5%9B%9B-Map%E9%9B%86%E5%90%88-%E9%9B%86%E5%90%88%E5%B5%8C%E5%A5%97/"
    >集合进阶(四)-(Map集合)(集合嵌套)(Collections)</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/07/30/%E9%9B%86%E5%90%88%E8%BF%9B%E9%98%B6-%E5%9B%9B-Map%E9%9B%86%E5%90%88-%E9%9B%86%E5%90%88%E5%B5%8C%E5%A5%97/" class="article-date">
  <time datetime="2020-07-30T14:11:02.000Z" itemprop="datePublished">2020-07-30</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="一、Map集合"><a href="#一、Map集合" class="headerlink" title="一、Map集合"></a>一、Map集合</h2><h3 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h3><ul>
<li><strong>Interface Map&lt;K,V&gt;</strong>  K: 键的类型；V：值的类型</li>
<li>将键映射到值的对象；不能包含重复的键；每个键可以映射到最多一个值</li>
<li>举例：学生的学号和姓名</li>
</ul>
<table>
<thead>
<tr>
<th>键</th>
<th>值</th>
</tr>
</thead>
<tbody><tr>
<td>001</td>
<td>张三</td>
</tr>
<tr>
<td>002</td>
<td>李四</td>
</tr>
</tbody></table>
<h4 id="创建Map集合的对象"><a href="#创建Map集合的对象" class="headerlink" title="创建Map集合的对象"></a>创建Map集合的对象</h4><ul>
<li>多态的方式</li>
<li>具体的实现类<strong>HashMap</strong></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">package</span> Map_;</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> java.util.HashMap;</span><br><span class="line"><span class="keyword">import</span> java.util.Map;</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> Object_.toString_;</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">demo1</span> </span>&#123;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">		Map&lt;String,String&gt; map=<span class="keyword">new</span> HashMap&lt;String,	String&gt;();</span><br><span class="line">		map.put(<span class="string">"001"</span>, <span class="string">"猪头新"</span>);</span><br><span class="line">		map.put(<span class="string">"002"</span>, <span class="string">"猪大头"</span>);</span><br><span class="line">		System.out.println(map);<span class="comment">//&#123;001=猪头新, 002=猪大头&#125;</span></span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
      
      <a class="article-more-link" href="/2020/07/30/%E9%9B%86%E5%90%88%E8%BF%9B%E9%98%B6-%E5%9B%9B-Map%E9%9B%86%E5%90%88-%E9%9B%86%E5%90%88%E5%B5%8C%E5%A5%97/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Map/" rel="tag">Map</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-集合进阶-三-泛型" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/07/29/%E9%9B%86%E5%90%88%E8%BF%9B%E9%98%B6-%E4%B8%89-%E6%B3%9B%E5%9E%8B/"
    >集合进阶(三)-(泛型)</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/07/29/%E9%9B%86%E5%90%88%E8%BF%9B%E9%98%B6-%E4%B8%89-%E6%B3%9B%E5%9E%8B/" class="article-date">
  <time datetime="2020-07-29T14:11:02.000Z" itemprop="datePublished">2020-07-29</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="一、泛型"><a href="#一、泛型" class="headerlink" title="一、泛型"></a>一、泛型</h2><h3 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h3><p><strong>泛型</strong>：是JDK5中引入的特性，它提供了编译时类型安全检测机制，该机制允许在编译时检测到非法的类型</p>
<p>本质是<strong>参数化类型</strong>，也就是说所操作的数据类型被指定为一个参数</p>
<p><strong>参数化类型</strong>就是<strong>将类型由原来的具体的类型参数化，然后在使用/调用时传入具体的类型</strong>。这种参数类型可以用在类、方法和接口中，分别被称为泛型类、泛型方法、泛型接口</p>
<h3 id="定义格式"><a href="#定义格式" class="headerlink" title="定义格式"></a>定义格式</h3><ul>
<li>&lt;类型&gt;：指定一种类型的格式。这里的类型可以看成是形参</li>
<li>&lt;类型1，类型2…&gt;:指定多种类型的格式，多种类型之间用逗号隔开。这里的类型可以看成是形参</li>
<li>将来具体调用时候给定的类型可以看成是实参，并且实参的类型只能是引用数据类型</li>
</ul>
<h3 id="泛型的好处"><a href="#泛型的好处" class="headerlink" title="泛型的好处"></a>泛型的好处</h3><ul>
<li>把运行时期的问题提前到编译期间</li>
<li>避免了强制类型转换</li>
</ul>
      
      <a class="article-more-link" href="/2020/07/29/%E9%9B%86%E5%90%88%E8%BF%9B%E9%98%B6-%E4%B8%89-%E6%B3%9B%E5%9E%8B/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%B3%9B%E5%9E%8B/" rel="tag">泛型</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-集合进阶-二-List-set" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/07/28/%E9%9B%86%E5%90%88%E8%BF%9B%E9%98%B6-%E4%BA%8C-List-set/"
    >集合进阶(一)-(List)-(set)</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/07/28/%E9%9B%86%E5%90%88%E8%BF%9B%E9%98%B6-%E4%BA%8C-List-set/" class="article-date">
  <time datetime="2020-07-28T14:11:02.000Z" itemprop="datePublished">2020-07-28</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="一、数据结构"><a href="#一、数据结构" class="headerlink" title="一、数据结构"></a>一、数据结构</h2><p>数据结构是计算机存储、组织数据的方式。是指相互之间存在一种或多种特定关系的数据元素的集合。通常情况下，精心选择的数据结构可以带来更高的运行或存储效率。</p>
<h3 id="常见数据结构-栈"><a href="#常见数据结构-栈" class="headerlink" title="常见数据结构-栈"></a>常见数据结构-栈</h3><p>数据进入栈模型的过程称为：<strong>进栈</strong></p>
<p>数据离开栈模型的过程称为：<strong>出栈</strong></p>
<p>栈是一种<strong>先进后出</strong>的模型</p>
<ul>
<li>A-B-C-D进，D-C-B-A出</li>
</ul>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-07-26_19-47-07.jpg?x-oss-process=image/resize,m_fill,h_180,w_290" alt=""></p>
      
      <a class="article-more-link" href="/2020/07/28/%E9%9B%86%E5%90%88%E8%BF%9B%E9%98%B6-%E4%BA%8C-List-set/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/List%E9%9B%86%E5%90%88/" rel="tag">List集合</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Set%E9%9B%86%E5%90%88/" rel="tag">Set集合</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/" rel="tag">数据结构</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Java-SE-集合进阶-一" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/07/26/Java-SE-%E9%9B%86%E5%90%88%E8%BF%9B%E9%98%B6-%E4%B8%80/"
    >集合进阶(一)-(Collection)-(List)</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/07/26/Java-SE-%E9%9B%86%E5%90%88%E8%BF%9B%E9%98%B6-%E4%B8%80/" class="article-date">
  <time datetime="2020-07-26T07:11:02.000Z" itemprop="datePublished">2020-07-26</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="一、集合体系结构"><a href="#一、集合体系结构" class="headerlink" title="一、集合体系结构"></a>一、集合体系结构</h2><p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-07-25_15-05-11.jpg" alt=""></p>
<h2 id="二、Collection集合概述和使用"><a href="#二、Collection集合概述和使用" class="headerlink" title="二、Collection集合概述和使用"></a>二、Collection集合概述和使用</h2><h4 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h4><ol>
<li>是单例集合的顶层接口，它表示一组对象，这些对象也称为Collection的元素</li>
<li>JDK不提供此接口的任何直接实现，它提供更具体的子接口(如Set和List)实现</li>
</ol>
<h4 id="创建Collection集合的对象"><a href="#创建Collection集合的对象" class="headerlink" title="创建Collection集合的对象"></a>创建Collection集合的对象</h4><ol>
<li>多态的形式</li>
<li>具体的实现类ArrayList</li>
</ol>
      
      <a class="article-more-link" href="/2020/07/26/Java-SE-%E9%9B%86%E5%90%88%E8%BF%9B%E9%98%B6-%E4%B8%80/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Collection/" rel="tag">Collection</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/List/" rel="tag">List</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Java-SE-异常" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/07/24/Java-SE-%E5%BC%82%E5%B8%B8/"
    >Java-SE 异常</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/07/24/Java-SE-%E5%BC%82%E5%B8%B8/" class="article-date">
  <time datetime="2020-07-24T14:50:02.000Z" itemprop="datePublished">2020-07-24</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="一、异常的定义"><a href="#一、异常的定义" class="headerlink" title="一、异常的定义"></a>一、异常的定义</h2><p>异常：阻止当前方法或作用域执行的问题。</p>
<p>要明确一点的是绝不应该用“正常”的态度看待异常。绝对一点说异常就是某种意义上的错误，就是问题，它可能会导致程序失败。之所以要提出异常处理机制，就是要告诉开发人员，你的程序出现了不正常的情况，需要注意。</p>
<h2 id="二、分类体系"><a href="#二、分类体系" class="headerlink" title="二、分类体系"></a>二、分类体系</h2><p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-07-24_15-58-10.jpg" alt=""></p>
<ol>
<li><strong>Throwable类</strong>是Java语言中所有错误或异常的超类（一切皆可抛）。他有两个子类Error和Exception。</li>
<li><strong>Error</strong>：严重问题，不需要处理，交给JVM吧</li>
</ol>
      
      <a class="article-more-link" href="/2020/07/24/Java-SE-%E5%BC%82%E5%B8%B8/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%BC%82%E5%B8%B8/" rel="tag">异常</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-日期类-Date-SimpleDateFormat-Calendar" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/07/24/%E6%97%A5%E6%9C%9F%E7%B1%BB-Date-SimpleDateFormat-Calendar/"
    >日期类(Date) (SimpleDateFormat) (Calendar)</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/07/24/%E6%97%A5%E6%9C%9F%E7%B1%BB-Date-SimpleDateFormat-Calendar/" class="article-date">
  <time datetime="2020-07-24T06:37:02.000Z" itemprop="datePublished">2020-07-24</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="一、Date类"><a href="#一、Date类" class="headerlink" title="一、Date类"></a>一、Date类</h2><h3 id="概述与构造方法"><a href="#概述与构造方法" class="headerlink" title="概述与构造方法"></a>概述与构造方法</h3><p>Date代表了一个特定的时间，精确到毫秒</p>
<table>
<thead>
<tr>
<th>方法名</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>public Date()</td>
<td>分配一个Date对象，并初始化，以便代表它被分配的时间，精确到毫秒</td>
</tr>
<tr>
<td>public Date(long date)</td>
<td>分配一个Date对象，并将其初始化为表示从标准基准时间起指定的毫秒数</td>
</tr>
</tbody></table>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-07-23_16-41-49.jpg" alt=""></p>
<h3 id="Date类的常用方法"><a href="#Date类的常用方法" class="headerlink" title="Date类的常用方法"></a>Date类的常用方法</h3>
      
      <a class="article-more-link" href="/2020/07/24/%E6%97%A5%E6%9C%9F%E7%B1%BB-Date-SimpleDateFormat-Calendar/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Calendar/" rel="tag">Calendar</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Date/" rel="tag">Date</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/SimpleDateFormat/" rel="tag">SimpleDateFormat</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-冒泡排序-Arrays-包装类" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/07/22/%E5%86%92%E6%B3%A1%E6%8E%92%E5%BA%8F-Arrays-%E5%8C%85%E8%A3%85%E7%B1%BB/"
    >(冒泡排序)(Arrays)(包装类)</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/07/22/%E5%86%92%E6%B3%A1%E6%8E%92%E5%BA%8F-Arrays-%E5%8C%85%E8%A3%85%E7%B1%BB/" class="article-date">
  <time datetime="2020-07-22T14:50:02.000Z" itemprop="datePublished">2020-07-22</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="一、冒泡排序"><a href="#一、冒泡排序" class="headerlink" title="一、冒泡排序"></a>一、冒泡排序</h2><p>一种排序方式，对要进行排序的数据进行两两比较，将较大的数据放在后面，依次对所有的数据进行操作，直至所有数据按要求完成排序</p>
<ul>
<li>n个数进行排序需要比较n-1次</li>
<li>每一次比较完毕下一次比较就少一个数据参与</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">package</span> ArrayListDemo;</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">demo3</span> </span>&#123;</span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">int</span>[] arr=&#123;<span class="number">22</span>,<span class="number">33</span>,<span class="number">24</span>,<span class="number">18</span>,<span class="number">65</span>,<span class="number">75</span>,<span class="number">65</span>&#125;;</span><br><span class="line">		<span class="keyword">for</span>(<span class="keyword">int</span> j=arr.length-<span class="number">1</span>;j&gt;=<span class="number">0</span>;j--)&#123;</span><br><span class="line">			<span class="keyword">for</span>(<span class="keyword">int</span> i=<span class="number">0</span>;i&lt;j;i++)&#123;</span><br><span class="line">				<span class="keyword">if</span>(arr[i]&gt;arr[i+<span class="number">1</span>])&#123;</span><br><span class="line">					<span class="keyword">int</span> temp=arr[i+<span class="number">1</span>];</span><br><span class="line">					arr[i+<span class="number">1</span>]=arr[i];</span><br><span class="line">					arr[i]=temp;</span><br><span class="line">				&#125;</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;</span><br><span class="line"></span><br><span class="line">		System.out.println(arrToString(arr));  <span class="comment">//[18,22,24,33,65,65,75]</span></span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">static</span> String <span class="title">arrToString</span><span class="params">(<span class="keyword">int</span>[] arr)</span></span>&#123;</span><br><span class="line">		StringBuilder s=<span class="keyword">new</span> StringBuilder();</span><br><span class="line">		s.append(<span class="string">"["</span>);</span><br><span class="line">		<span class="keyword">for</span>(<span class="keyword">int</span> i=<span class="number">0</span>;i&lt;arr.length;i++)&#123;</span><br><span class="line">			<span class="keyword">if</span>(i==arr.length-<span class="number">1</span>)&#123;</span><br><span class="line">				s.append(arr[i]);</span><br><span class="line">			&#125;<span class="keyword">else</span>&#123;</span><br><span class="line">				s.append(arr[i]+<span class="string">","</span>);</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;</span><br><span class="line">		s.append(<span class="string">"]"</span>);</span><br><span class="line">		<span class="keyword">return</span> s.toString();</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
      
      <a class="article-more-link" href="/2020/07/22/%E5%86%92%E6%B3%A1%E6%8E%92%E5%BA%8F-Arrays-%E5%8C%85%E8%A3%85%E7%B1%BB/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Arrays%E7%B1%BB/" rel="tag">Arrays类</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%86%92%E6%B3%A1%E6%8E%92%E5%BA%8F/" rel="tag">冒泡排序</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Math-System-Object-类" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/07/22/Math-System-Object-%E7%B1%BB/"
    >(Math)(System)(Object)类</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/07/22/Math-System-Object-%E7%B1%BB/" class="article-date">
  <time datetime="2020-07-22T06:50:02.000Z" itemprop="datePublished">2020-07-22</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="一、Math类"><a href="#一、Math类" class="headerlink" title="一、Math类"></a>一、Math类</h2><p>Math包含执行基本数字运算的方法</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-07-21_18-08-09.jpg" alt=""></p>
<p>通过查看文档发现成员变量和成员方法都用static修饰了，故可以直接通过类名来调用。</p>
<h3 id="Math类常用方法"><a href="#Math类常用方法" class="headerlink" title="Math类常用方法"></a>Math类常用方法</h3>
      
      <a class="article-more-link" href="/2020/07/22/Math-System-Object-%E7%B1%BB/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Math%E7%B1%BB/" rel="tag">Math类</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Object%E7%B1%BB/" rel="tag">Object类</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/System%E7%B1%BB/" rel="tag">System类</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-引用类型作形参和返回值-内部类" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/07/21/%E5%BC%95%E7%94%A8%E7%B1%BB%E5%9E%8B%E4%BD%9C%E5%BD%A2%E5%8F%82%E5%92%8C%E8%BF%94%E5%9B%9E%E5%80%BC-%E5%86%85%E9%83%A8%E7%B1%BB/"
    >（引用类型作形参和返回值）（内部类）</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/07/21/%E5%BC%95%E7%94%A8%E7%B1%BB%E5%9E%8B%E4%BD%9C%E5%BD%A2%E5%8F%82%E5%92%8C%E8%BF%94%E5%9B%9E%E5%80%BC-%E5%86%85%E9%83%A8%E7%B1%BB/" class="article-date">
  <time datetime="2020-07-21T08:50:02.000Z" itemprop="datePublished">2020-07-21</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="一、类名作为形参和返回值"><a href="#一、类名作为形参和返回值" class="headerlink" title="一、类名作为形参和返回值"></a>一、类名作为形参和返回值</h2><ul>
<li>方法的形参是类名，其实需要的是该类的对象</li>
<li>方法的返回值是类名，其实返回的是该类的对象</li>
</ul>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-07-20_19-27-31.jpg" alt=""></p>
<h2 id="二、抽象类名作为形参和返回值"><a href="#二、抽象类名作为形参和返回值" class="headerlink" title="二、抽象类名作为形参和返回值"></a>二、抽象类名作为形参和返回值</h2><ul>
<li>方法的形参是抽象类名，其实需要的是该抽象类的子类对象</li>
<li>方法的返回值是抽象类名，其实返回的是该抽象类的子类对象
      
      <a class="article-more-link" href="/2020/07/21/%E5%BC%95%E7%94%A8%E7%B1%BB%E5%9E%8B%E4%BD%9C%E5%BD%A2%E5%8F%82%E5%92%8C%E8%BF%94%E5%9B%9E%E5%80%BC-%E5%86%85%E9%83%A8%E7%B1%BB/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%86%85%E9%83%A8%E7%B1%BB/" rel="tag">内部类</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Java-SE-接口" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/07/20/Java-SE-%E6%8E%A5%E5%8F%A3/"
    >Java SE-接口</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/07/20/Java-SE-%E6%8E%A5%E5%8F%A3/" class="article-date">
  <time datetime="2020-07-20T12:50:02.000Z" itemprop="datePublished">2020-07-20</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="一、什么是接口"><a href="#一、什么是接口" class="headerlink" title="一、什么是接口"></a>一、什么是接口</h2><p>接口就是一种<strong>公共的规范标准</strong>，大家都可以通用，Java中的接口更多体现在<strong>对行为的抽象</strong></p>
<h2 id="二、接口特点"><a href="#二、接口特点" class="headerlink" title="二、接口特点"></a>二、接口特点</h2><ul>
<li><p>接口用关键字<strong>interface</strong>修饰</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">interface</span> 接口名</span>&#123;&#125;</span><br></pre></td></tr></table></figure></li>
<li><p>类实现接口用<strong>implements</strong>表示</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> 类名 <span class="keyword">implements</span> 接口名</span>&#123;&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>接口不能实例化</p>
</li>
</ul>
<blockquote>
<p>参照多态的方式，通过实现类对象实例化，这叫接口多态。</p>
</blockquote>
<blockquote>
<p>多态的形式：具体类多态、<strong>抽象类多态、接口多态</strong></p>
</blockquote>
<blockquote>
<p>多态的前提：有继承或实现关系；有方法重写；有父（类、接口）引用指向（子、实现）类对象</p>
</blockquote>
      
      <a class="article-more-link" href="/2020/07/20/Java-SE-%E6%8E%A5%E5%8F%A3/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%8E%A5%E5%8F%A3/" rel="tag">接口</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
  </article>
  

  
  <nav class="page-nav">
    
    <a class="extend prev" rel="prev" href="/page/5/">上一页</a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/4/">4</a><a class="page-number" href="/page/5/">5</a><span class="page-number current">6</span><a class="page-number" href="/page/7/">7</a><a class="page-number" href="/page/8/">8</a><span class="space">&hellip;</span><a class="page-number" href="/page/10/">10</a><a class="extend next" rel="next" href="/page/7/">下一页</a>
  </nav>
  
</section>
</div>

      <footer class="footer">
  <div class="outer">
    <ul class="list-inline">
      <li>
        &copy;
        2020-2021
        张金
      </li>
      <li>
        
      </li>
    </ul>
    <ul class="list-inline">
      <li>
        
        
        <span>
  <i>PV:<span id="busuanzi_value_page_pv"></span></i>
  <i>UV:<span id="busuanzi_value_site_uv"></span></i>
</span>
        
      </li>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
        <img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/beian.png">
        <a href="https://beian.miit.gov.cn"  style="color:#f72b07" target="_blank">陕ICP备20002449号</a>
      </li>

    </ul>
  </div>
</footer>
    <div class="to_top">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>
      </div>
    </main>
      <aside class="sidebar">
        <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="Yolin"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/playlist">歌单</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/video">视频</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/about">关于我</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/friends">友情链接</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
      </aside>
      <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
      
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/jquery.justifiedGallery.min.js"></script>


<script src="/js/lazyload.min.js"></script>


<script src="/js/busuanzi-2.3.pure.min.js"></script>


<script src="/js/share.js"></script>




<script>
  try {
    var typed = new Typed("#subtitle", {
    strings: ['肠断月明红豆蔻,','月似当时,','人似当时否？'],
    startDelay: 1500,
    typeSpeed: 200,
    loop: true,
    backSpeed: 40,
    showCursor: true
    });
  } catch (err) {
  }
  
</script>




<script>
  var ayerConfig = {
    mathjax: true
  }
</script>


<script src="/js/ayer.js"></script>


<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>



<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
      tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
  });

  MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for(i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
      }
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.6/unpacked/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>


<script type="text/javascript" src="https://js.users.51.la/20544303.js"></script>
  </div>
</body>

</html>